
-- FirstLua = {}

-- local this = FirstLua

-- local GameObject = UnityEngine.GameObject
-- local ParticleSystem = UnityEngine.ParticleSystem
-- local PrimitiveType = UnityEngine.PrimitiveType

-- local Ray = UnityEngine.Ray
-- local Input = UnityEngine.Input
-- local Camera = UnityEngine.Camera
-- local RaycastHit = UnityEngine.RaycastHit
-- local Physics = UnityEngine.Physics
-- local Text = UnityEngine.UI.Text

-- --整个Lua逻辑的入口

-- this.score = 0

-- function FirstLua.Init()

-- 	this.scoreText = GameObject.Find("Canvas/Text"):GetComponent(typeof(Text))

-- 	coroutine.start(FirstLua.CreateMouse)

-- 	coroutine.start(FirstLua.Update)

-- end

-- function FirstLua.CreateMouse()
-- 	while(true)do
-- 		coroutine.wait(1)

-- 		local go = GameObject.CreatePrimitive(PrimitiveType.Cube);
-- 		go.tag = "Player"
-- 		go.transform.position = Vector3(math.random(0,15),math.random(0,15),math.random(0,10)) 
-- 		GameObject.Destroy(go.gameObject,1.5)
-- 	end
-- end

-- function FirstLua.Update()
-- 	while(true)do
-- 		coroutine.step()
--         if (Input.GetMouseButtonDown(0))then
--         	local ray = Camera.main:ScreenPointToRay(Input.mousePosition);
--         	local flag, hit = Physics.Raycast(ray, nil)
-- 			if(flag)then
-- 				if (hit.collider.tag=="Player")then
-- 					GameObject.Destroy(hit.transform.gameObject)
-- 					this.score = this.score+1
-- 					this.scoreText.text = "Score:"..this.score
-- 				end
-- 			end
-- 		end	
--     end      
-- end
